/**
 * This class is the main view for the application. It is specified in app.js as the
 * "autoCreateViewport" property. That setting automatically applies the "viewport"
 * plugin to promote that instance of this class to the body element.
 *
 * TODO - Replace this content of this view to suite the needs of your application.
 */
Ext.define('app.view.main.Main', {
	
    extend: 'Ext.container.Container',
    
    requires: [
        'app.view.main.MainController',
        'app.view.main.MainModel'
    ],

    uses: [
    	'app.view.main.region.Top',
    	'app.view.main.region.Bottom',
        'app.view.main.region.Left',
        'app.view.main.region.Center'
    ],
    
    xtype: 'app-main',
    
    controller: 'main',
    
    viewModel: {
        type: 'main'
    },
    
    initComponent : function() {
		Ext.setGlyphFontFamily('FontAwesome'); // 设置图标字体文件，只有设置了以后才能用glyph属性
		this.callParent();
	},
	
	listeners : {
		resize : function(container) { //界面的大小发生变化的时候会触发此事件
			container.getController().onMainResize();
		}
	},

    layout: {
        type: 'border'
    },

    items: [{
    	xtype: 'maintop',
    	region: 'north'
    }, {
    	xtype: 'mainleft',
    	region: 'west',
    	width: 220,
        title : '导航菜单',
        collapsible : true,
		split : true
    }, {
    	xtype: 'maincenter',
    	region: 'center'
    }, {
    	xtype: 'mainbottom',
    	region: 'south'
    }]
});
